using System;

namespace System.Resources.SqlResource
{
    public class SqlResourceManager:ResourceManager
    {
        private readonly Globalization.CultureInfo _culture;

        public SqlResourceManager()
        { 
            _culture = System.Globalization.CultureInfo.CurrentUICulture;
        }

        public SqlResourceManager(Globalization.CultureInfo culture)
        {
            _culture = culture;
        }

        public override object GetObject(string name)
        {
            SqlResourceSet rs = new SqlResourceSet(_culture);
            if (base.IgnoreCase)
                {return rs.GetObject(name, base.IgnoreCase);}
            else
                {return rs.GetObject(name);}
        }

        public override object GetObject(string name, Globalization.CultureInfo culture)
        {
            SqlResourceSet rs = new SqlResourceSet(culture);
            if (base.IgnoreCase)
                { return rs.GetObject(name, base.IgnoreCase); }
            else
                { return rs.GetObject(name); }
        }

        public override string GetString(string name)
        {
            SqlResourceSet rs = new SqlResourceSet(_culture);
            if (base.IgnoreCase)
                { return rs.GetString(name, base.IgnoreCase); }
            else
                { return rs.GetString(name); }
        }

        public override string GetString(string name, Globalization.CultureInfo culture)
        {
            SqlResourceSet rs = new SqlResourceSet(culture);
            if (base.IgnoreCase)
                { return rs.GetString(name, base.IgnoreCase); }
            else
                { return rs.GetString(name); }
        }

        public override ResourceSet GetResourceSet(Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents)
        {
            SqlResourceSet rs = new SqlResourceSet(culture);
            return rs;
        }

        public override void ReleaseAllResources()
            {return;}

        public override Type ResourceSetType
        {
            get {return typeof(SqlResourceSet);}
        }
    }
}
